package com.base.controller;

import com.base.common.AjaxResult;
import com.base.common.BaseController;
import com.base.common.LoginBody;
import com.base.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author gxd
 * @since 2025/6/8
 */
@Slf4j
@RestController
@Api(tags = "登录管理")
public class LoginController extends BaseController {

    @Autowired
    private LoginService loginService;

    @ApiOperation("登录")
    @PostMapping("/login")
    public AjaxResult login(@ApiParam(value = "登录实体") @RequestBody LoginBody loginBody) throws Exception {
        return success(loginService.login(loginBody));
    }
}
